using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace Dal.Models.Mapping
{
    public class MEETLISTMap : EntityTypeConfiguration<MEETLIST>
    {
        public MEETLISTMap()
        {
            // Primary Key
            this.HasKey(t => new { t.NUM, t.PHONE });

            // Properties
            this.Property(t => t.NUM)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.PHONE)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.ANSER)
                .HasMaxLength(50);

            this.Property(t => t.RTIME)
                .HasMaxLength(50);

            this.Property(t => t.ZJ)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("MEETLIST");
            this.Property(t => t.NUM).HasColumnName("NUM");
            this.Property(t => t.PHONE).HasColumnName("PHONE");
            this.Property(t => t.ANSER).HasColumnName("ANSER");
            this.Property(t => t.RTIME).HasColumnName("RTIME");
            this.Property(t => t.ZJ).HasColumnName("ZJ");
        }
    }
}
